<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>积分平台</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/lib/datepicker.min.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/mui/css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/mui/css/mui.picker.min.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/leave.css"/>
		<script src="__INDEX__/js/lib/font.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
	    <header class="mui-bar mui-bar-nav">
	        <a class="mui-icon mui-icon-left-nav mui-pull-left goindex" style="color: #ffffff"></a>
	        <h1 class="mui-title">请假条</h1>
	    </header>

	    <div class="mui-content">
			<form id="forms" enctype="multipart/form-data">
	    	<div class="modular">
				<div class="mui-input-row" id="leaveType">
			        <label>请假类型：</label>
			    	<input type="text" id="leaveInfo" name="leave_type"  class="mui-input-clear"  value="事假" />
					<span class="mui-icon mui-icon-arrowright"></span>
				</div>
			</div>
			<div class="modular">
				<div class="mui-input-row">
			        <label>开始时间：</label>
			        <input type="text" class="mui-input-clear" name="starttime" id="date" value="" />
			        <span class="mui-icon mui-icon-arrowright"></span>
				</div>
			</div>
			<div class="modular">
				<div class="mui-input-row">
			        <label>结束时间：</label>
			        <input type="text" class="mui-input-clear" name="endtime" id="date2" value="" />
			        <span class="mui-icon mui-icon-arrowright"></span>
				</div>
			</div>
			
			<div class="modular">
				<textarea name="reason" class="textCont" placeholder="请填写您的请假理由(500字以内)" ></textarea>
				<div class="cont-bottom">
					<div class="addImg mui-pull-left">
						<!--<a class="defaultImg" >-->
							<!--<label for='test1'>-->
								<!--<img src="__INDEX__/images/addImg.png"/>-->
							<!--</label>-->
							<!--<input class="xiangce" id="test1"  type="file" accept="image/*">-->
						<!--</a>-->
						<input id="test1"  type="file" name="leave_picture[]" accept="image/*" multiple>
					</div>
					<p class="mui-pull-right">最多添加3张图片</p>
				</div>
			</div>
			<div class="modular">
				<div class="mui-input-row">
					<a href="{:url('index/recipient')}">
						 <label>发送假条：</label>
				    	<input type="text" class="mui-input-clear" id="jieshou" disabled="disabled" placeholder="添加接收人">
						<input type="text" name="approver_id" style="display: none">
				    	<span class="mui-icon mui-icon-arrowright"></span>
					</a>
				</div>
			</div>
			</form>
	    </div>
	    <button class="btn mui-btn mui-btn-block">确定发送</button>
		<script src="__INDEX__/js/lib/zepto.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/lib/datepicker.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/mui/js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/mui/js/mui.view.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/mui/js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/layer_mobile/layer.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/common.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/leave.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/jquery.3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/maowenke.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
            $(".goindex").on('tap',function () {
                window.location.href = "{:url('index/index')}";
            });
			$('.btn').on('tap',function () {
				ajax($("#forms"),"{:url('add/leave')}",function (data) {
					if(data.code==200){
					    mui.alert(data.msg);
					    setTimeout(function () {
							window.location.href="{:url('index/index')}"
                        },1500);
					}else{
					    mui.alert(data.msg);
					}
                })
            });
		    
		</script>
	</body>
</html>
